local NewGame = GV:addState('NewGame')
function NewGame:enterState()
	clearLoveCallbacks()
	print("entering new game state")

	local select_input = "name"
	local name = ""
	local gender = ""

	reset_vars()


	function love.draw()

		love.graphics.print("name : ",
			64, 96)
		love.graphics.print("gender (m or f): ",
			64, 108)
		love.graphics.print(name,
			256, 96)
		love.graphics.print(gender,
			256, 108)
		love.graphics.print("Tab to switch between entries\nReturn when done",
			64, 128)
	end

	function love.update(dt)


	end

	function love.keypressed(key, unicode)
		if select_input == "name" then
			if key == 'backspace' then
				name = string.sub(name,1,-2)
			elseif unicode > 31 and unicode < 127 then

				name = name .. string.char(unicode)
			end

		elseif select_input == "gender" then
			if key == 'backspace' then
				gender = string.sub(gender,1,-2)
			elseif unicode == 109 or unicode == 102
				or unicode == 77 or unicode == 70 then

				gender = string.char(unicode)
			end

		end

		if key == 'tab' then

			if select_input == "name" then
				select_input = "gender"
			elseif select_input == "gender" then
				select_input = "name"
			end

		end

		if key == 'return' then
			if name ~= "" then
				data.player.name = name
			else
				data.player.name = "packie"
			end

			if gender ~= "" then
				data.player.gender = gender
			else
				data.player.gender = "f"
			end

			print("n : ", name, "g: ", gender)
			build_town()
			--print(table.tostring(maps.town))
			gv:gotoState('Town')
		end


	end





end
function NewGame:exitState()
	print("exiting new game state")
end
